const path = require('path');
const {name} = require('./package');
function resolve(dir) {
      return path.join(__dirname, dir)
}
const packageName = name;
const port = 9004

module.exports = {
  outputDir:'dist',
  assetsDir: 'static',
  filenameHashing:true,
  publicPath:'http://localhost:9004',
  devServer:{
    static: {
      directory: path.join(__dirname, './dist'),
    },
    historyApiFallback: true,
    allowedHosts: 'all',
    hot:false,
    port,
    headers:{
      "Access-Control-Allow-Origin": "*", // 主应用获取子应用时跨域响应头
    }

  },
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
    output:{
      library: `${packageName}`,
      libraryTarget: "umd", // 把微应用打包成 umd 库格式
    }

  }
 
    

}